{#include file="aj/pageheader.html"#}
<script type="text/javascript">
    $(function () {
        $('#list-table').tableHover();
    })
</script>


<h1>
    <span class="action-span1"><a href="#">产品列表</a> </span>
    <span class="action-span"><a href="{#spUrl c=goods a=addpage#}">添加产品</a></span>
</h1>
<div class="form-div">
    <form action="{#spUrl c=goods a=index#}" name="searchForm" method="post">
        <img src="themes/aj/images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH"/>
        <select name="cat_id">
            <option value="0">全部分类</option>
            {#foreach item=cat from=$cat_select#}
                <option value="{#$cat.id#}" style="padding-left:{#$cat.level*20#}px">{#$cat.catename#}</option>
            {#/foreach#}
        </select>
        信息标题 <input type="text" name="keyword" id="keyword"/>
        <input type="submit" value="搜索" class="button"/>
    </form>
</div>
<form method="post" action="{#spUrl c=goods a=batch#}" name="listForm">
    <!-- start ad position list -->
    <div class="list-div" id="listDiv">

        <table width="100%" cellspacing="1" cellpadding="2" id="list-table" class="table">
            <tr>
                <th height="28"><input type="checkbox" onclick='selectAll(this,"checkboxes")'/>编号</th>
                <th width="336">信息标题</th>
                <th width="299">信息分类</th>
                <th width="203">产品图片</th>
                <th width="128">是否新品</th>
                <th width="128">是否推荐首页</th>
                <th width="128">是否热销首页</th>
                <th width="124">操作</th>
            </tr>
            {#foreach item=goods_list from=$rows#}
                <tr>
                    <td width="170"><input type="checkbox" name="checkboxs[]"
                                           value="{#$goods_list.id#}">{#$goods_list.id#}</td>
                    <td align="left">&nbsp;&nbsp;&nbsp;<strong>{#$goods_list.title#}</strong></td>
                    <td align="center">{#$goods_list.catename#}</td>
                    <td align="center"><img src="uploads/sm_goods/{#$goods_list.upfile#}" width="100" height="100"/>
                    </td>
                    <td align="center">{#if $goods_list.hot eq 1#}<a
                            href="{#spUrl c=goods a=upttt id=$goods_list.id hot=1#}" style="color:#F00">是</a>{#else#}
                        <a href="{#spUrl c=goods a=upttt id=$goods_list.id hot=0#}">否</a>{#/if#}</td>
                    <td align="center">{#if $goods_list.promote eq 1#}<a
                            href="{#spUrl c=goods a=upt id=$goods_list.id promote=1#}" style="color:#F00">是</a>{#else#}
                            <a href="{#spUrl c=goods a=upt id=$goods_list.id promote=0#}">否</a>{#/if#}</td>
                    <td align="center">{#if $goods_list.new eq 1#}<a
                            href="{#spUrl c=goods a=uptt id=$goods_list.id new=1#}" style="color:#F00">是</a>{#else#}<a
                            href="{#spUrl c=goods a=uptt id=$goods_list.id new=0#}">否</a>{#/if#}</td>

                    <td align="center">
    	<span>
    		<!--<a title="查看" target="_blank"><img width="16" height="16" border="0" src="themes/aj/images/icon_view.gif"></a>&nbsp;-->
            <!-- <a title="相册" href="{#spUrl c=goodsimg a=index pid=$goods_list.id#}"><img width="16" height="16" border="0" src="themes/aj/images/jpg.gif"></a> -->&nbsp;
    		<a title="编辑" href="{#spUrl c=goods a=editpage id=$goods_list.id#}"><img width="16" height="16" border="0"
                                                                                     src="themes/aj/images/icon_edit.gif"></a>&nbsp;
    		<a title="移除" href="{#spUrl c=goods a=delete id=$goods_list.id#}"
               onclick="if(confirm('您确认要删除这条记录吗？')){return true}return false;"><img width="16" height="16" border="0"
                                                                                    src="themes/aj/images/icon_drop.gif"></a></span>
                    </td>
                </tr>
            {#/foreach#}
            <tr>
                <td colspan="9" height="30" bgcolor="#80BDCB" id="pager">
                    {#if $pager#}
                        共有{#$pager.total_count#}条信息，共有{#$pager.total_page#}页（每页{#$pager.page_size#}条信息）：
                        <!--在当前页不是第一页的时候，显示前页和上一页-->
                        {#if $pager.current_page != $pager.first_page#}
                            <a href="{#spUrl c=goods a=index page=$pager.first_page#}">前页</a>
                            |
                            <a href="{#spUrl c=goods a=index page=$pager.prev_page#}">上一页</a>
                            |
                        {#/if#}
                        <!--开始循环页码，同时如果循环到当前页则不显示链接-->
                        {#foreach from=$pager.all_pages item=thepage#}
                            {#if $thepage != $pager.current_page#}
                                <a href="{#spUrl c=goods a=index page=$thepage#}">{#$thepage#}</a>
                            {#else#}
                                <b>{#$thepage#}</b>
                            {#/if#}
                        {#/foreach#}
                        <!--在当前页不是最后一页的时候，显示下一页和后页-->
                        {#if $pager.current_page != $pager.last_page#} |
                            <a href="{#spUrl c=goods a=index page=$pager.next_page#}">下一页</a>
                            |
                            <a href="{#spUrl c=goods a=index page=$pager.last_page#}">后页</a>
                        {#/if#}
                    {#/if#}
                </td>
            </tr>
        </table>
        <div>
            <select name="type">
                <option value="">请选择...</option>
                <option value="button_remove">批量删除</option>
                <option value="button_hide">批量隐藏</option>
                <option value="button_show">批量显示</option>
            </select>

            <input type="submit" class="button" name="btnSubmit" id="btnSubmit" value="确定">
        </div>

    </div>
</form>


{#include file="aj/pagefooter.html"#}